#ifndef AESCRYPTO_H
#define AESCRYPTO_H
#include <iostream>
#include <openssl/aes.h>
#include <openssl/rand.h>
#include <cstring>

class AESCrypto
{
public:
    AESCrypto(unsigned char* key);
    std::string encrypt(const std::string& plaintext);
    std::string decrypt(const std::string& ciphertext);

private:
    unsigned char key[AES_BLOCK_SIZE];

    void PKCS7_padding(unsigned char* data, int len, int blockSize);

    int PKCS7_unpadding(unsigned char* data, int len);
};

#endif // AESCRYPTO_H
